// npm install xxxx   添加到项目依赖
// npm install xxxx -D 添加到开发依赖
// npm install xxxx -g 添加到全局依赖

let isOK:boolean
let age = 20
console.log(typeof age)
let user = "voldy"
function use(e){
    return e.toUpperCase()
}
let res = use(user)
console.log(res)

user = "LIST"
isOK = false

function changeNameToUpper1(xxx:string):string{
    let a = xxx.toUpperCase()
    return a 
}

let xx:(a:number,b:number)=>number = function(a:number,b:number):number{
    return a+b
}

let mm = (a:number,b:number):number =>{
    return a+b
}

let nn:(a:number,b:number) => number = (a:number,b:number):number =>{
    return a+b
}
// 新增了对nn函数的类型和形式进行了规范
console.log(nn(2, 3))

let nm:(a:number,b:number)=>number=(a,b)=>{
    return a-b
}
console.log(nm(10,2))

let res3 = changeNameToUpper1(user)
console.log(res3)

let res2 = changeNameToUpper1("hello")
console.log(res2)

let logMes = function (name:string,age:number):void{
    console.log(`name: ${name} , age: ${age}`)
}
logMes(user,age)

let logMes2:(name:string,age:number)=>void = function (name:string,age:number):void{
    console.log(`name: ${name} , age: ${age}`)
}
logMes2(user,age)